/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package epul.bdav;

import java.sql.Connection;
import java.sql.SQLException;
import oracle.jdbc.pool.OracleDataSource;
//import org.postgresql.ds.PGSimpleDataSource;

/**
 *
 * @author ecoquery
 */
public class Connexion {
    
//    public Connection seConnecterPostgreSQL() throws SQLException {
//        PGSimpleDataSource dataSource = new PGSimpleDataSource();
//        dataSource.setDatabaseName("postgres");
//        dataSource.setUser("etudiant");
//        dataSource.setPassword("etudiant");
//        return dataSource.getConnection();
//    }

    public Connection seConnecterOracle() throws SQLException {
        OracleDataSource ods = new OracleDataSource();
        ods.setDriverType("thin");
       // ods.setServerName("pedagowin710");
        ods.setServerName("localhost");
        ods.setPortNumber(1521);
       ods.setDatabaseName("orapeda1");
//        ods.setDatabaseName("xe");
//        return ods.getConnection("system", "localhost");
        return ods.getConnection("EPU2A08", "EPU2A08");
    }
    
}
